import java.util.Date;

public class BenchmarkTest {
	private int count;

	public BenchmarkTest(int count) {
		this.count = count;
		System.out.println("性能测试，复制次数：" + this.count);
	}

	public void benchmark(IMethodCallBack m, FromBean frombean) {
		try {
			long begin = new Date().getTime();
			@SuppressWarnings("unused")
			ToBean tobean = null;
			System.out.println(m.getMethodName() + "开始进行测试");
			for (int i = 0; i < count; i++) {
				tobean = m.callMethod(frombean);
			}
			long end = new Date().getTime();
			System.out.println(m.getMethodName() + "耗时" + (end - begin));
			System.out.println("                                      ");
		}
		catch (Exception e){
			e.printStackTrace();
		}
	}
}